//
//  Event.m
//  cliqset
//
//  Created by David Hinson on 2/25/09.
//  Copyright 2009 Sumner Systems Management, Inc.. All rights reserved.
//

#import "Event.h"


@implementation Event

@synthesize mode            = _mode;
@synthesize eventIdentifier = _eventIdentifier;
@synthesize createDate      = _createDate;
@synthesize eventType       = _eventType;
@synthesize title           = _title;
@synthesize body            = _body;
@synthesize url				= _url;
@synthesize sourceService   = _sourceService;
@synthesize userIdentifier  = _userIdentifier;
@synthesize sourceUser      = _sourceUser;
@synthesize resources       = _resources;

-(id)init {
	self = [super init];

	//self.eventIdentifier = [[NSMutableString alloc] init];
	//self.eventType       = [[NSMutableString alloc] init];
	//self.title           = [[NSMutableString alloc] init];
	//self.body            = [[NSMutableString alloc] init];
	//self.url			   = [[NSMutableString alloc] init];
	self.sourceService     = [[SourceService alloc] init];
	self.sourceUser        = [[BasicProfile alloc] init];
	self.resources         = [[NSMutableArray alloc] init];
	
	return self;
}

-(void)dealloc {
	
	[_eventIdentifier release];
	[_createDate release];
	[_eventType release];
	[_title release];
	[_body release];
	[_url release];
	[_sourceService release];
	[_sourceUser release];
	[_userIdentifier release];
	[_resources release];
	
	[super dealloc];
}

@end

@implementation SourceService

@synthesize consumerKey = _consumerKey;
@synthesize name        = _name;
@synthesize logoURL     = _logoURL;
@synthesize logoBlob    = _logoBlob;
@synthesize iconURL     = _iconURL;
@synthesize iconBlob    = _iconBlob;
@synthesize websiteURL  = _websiteURL;

-(id)init {
	self = [super init];
	
	//self.consumerKey = [[NSMutableString alloc] init];
	//self.name        = [[NSMutableString alloc] init];
	//self.logoURL     = [[NSMutableString alloc] init];
	//self.iconURL     = [[NSMutableString alloc] init];
	//self.websiteURL  = [[NSMutableString alloc] init];
	
	return self;
}

-(void)dealloc {
	[_consumerKey release];
	[_name release];
	[_logoURL release];
	[_logoBlob release];
	[_iconURL release];
	[_iconBlob release];
	[_websiteURL release];
	[super dealloc];
}

@end

@implementation Resource

@synthesize name=_name;
@synthesize value=_value;
@synthesize blob=_blob;

-(id)init {
	self = [super init];
	return self;
}

-(void)dealloc {
	[_blob release];
	[_name release];
	[_value release];
	[super dealloc];
}

@end


